'skins.vector.styles' and 'skins.monobook.styles', respectively,
and their definition was changed not to include the common*.css files;
the two skins now load the 'skins.common.interface' module instead.
+* A page_links_updated field has been added to the page table.
== Compatibility ==
*/
protected $mTouched = '19700101000000';
+ /**
+ * @var string
+ */
+ protected $mLinksUpdated = '19700101000000';
+
/**
* @var int|null
*/
$this->mRedirectTarget = null; // Title object if set
$this->mLastRevision = null; // Latest revision
$this->mTouched = '19700101000000';
+ $this->mLinksUpdated = '19700101000000';
$this->mTimestamp = '';
$this->mIsRedirect = false;
$this->mLatest = false;
'page_is_new',
'page_random',
'page_touched',
+ 'page_links_updated',
'page_latest',
'page_len',
);
$this->mId = intval( $data->page_id );
$this->mCounter = intval( $data->page_counter );
$this->mTouched = wfTimestamp( TS_MW, $data->page_touched );
+ $this->mLinksUpdated = wfTimestampOrNull( TS_MW, $data->page_links_updated );
$this->mIsRedirect = intval( $data->page_is_redirect );
$this->mLatest = intval( $data->page_latest );
// Bug 37225: $latest may no longer match the cached latest Revision object.
return $this->mTouched;
}
+ /**
+ * Get the page_links_updated field
+ * @return string|null containing GMT timestamp
+ */
+ public function getLinksTimestamp() {
+ if ( !$this->mDataLoaded ) {
+ $this->loadPageData();
+ }
+ return $this->mLinksUpdated;
+ }
+
/**
* Get the page_latest field
* @return integer rev_id of current revision
$changed = $propertiesDeletes + array_diff_assoc( $this->mProperties, $existing );
$this->invalidateProperties( $changed );
+ # Update the links table freshness for this title
+ $this->updateLinksTimestamp();
+
# Refresh links of all pages including this page
# This will be in a separate transaction
if ( $this->mRecursive ) {
return $result;
}
+
+ /**
+ * Update links table freshness
+ */
+ protected function updateLinksTimestamp() {
+ if ( $this->mId ) {
+ $this->mDb->update( 'page',
+ array( 'page_links_updated' => $this->mDb->timestamp() ),
+ array( 'page_id' => $this->mId ),
+ __METHOD__
+ );
+ }
+ }
}
/**
array( 'addField', 'recentchanges', 'rc_source', 'patch-rc_source.sql' ),
array( 'addIndex', 'logging', 'log_user_text_type_time', 'patch-logging_user_text_type_time_index.sql' ),
array( 'addIndex', 'logging', 'log_user_text_time', 'patch-logging_user_text_time_index.sql' ),
+ array( 'addField', 'page', 'page_links_updated', 'patch-page_links_updated.sql' ),
);
}
// 1.23
array( 'addPgField', 'recentchanges', 'rc_source', "TEXT NOT NULL DEFAULT ''" ),
+ array( 'addPgField', 'page', 'page_links_updated', "TIMESTAMPTZ NULL" ),
);
}
array( 'addField', 'recentchanges', 'rc_source', 'patch-rc_source.sql' ),
array( 'addIndex', 'logging', 'log_user_text_type_time', 'patch-logging_user_text_type_time_index.sql' ),
array( 'addIndex', 'logging', 'log_user_text_time', 'patch-logging_user_text_time_index.sql' ),
+ array( 'addField', 'page', 'page_links_updated', 'patch-page_links_updated.sql' ),
);
}
if ( isset( $this->params['rootJobTimestamp'] ) ) {
$page = WikiPage::factory( $title );
$skewedTimestamp = wfTimestamp( TS_UNIX, $this->params['rootJobTimestamp'] ) + 5;
+ if ( $page->getLinksTimestamp() > wfTimestamp( TS_MW, $skewedTimestamp ) ) {
+ // Something already updated the backlinks since this job was made
+ return true;
+ }
if ( $page->getTouched() > wfTimestamp( TS_MW, $skewedTimestamp ) ) {
$parserOptions = $page->makeParserOptions( 'canonical' );
$parserOutput = ParserCache::singleton()->getDirty( $page, $parserOptions );
--- /dev/null
+ALTER TABLE /*$wgDBprefix*/page
+ ADD page_links_updated varbinary(14) NULL default NULL;
page_is_new SMALLINT NOT NULL DEFAULT 0,
page_random NUMERIC(15,14) NOT NULL DEFAULT RANDOM(),
page_touched TIMESTAMPTZ,
+ page_links_updated TIMESTAMPTZ NULL,
page_latest INTEGER NOT NULL, -- FK?
page_len INTEGER NOT NULL,
page_content_model TEXT
-- of contained templates.
page_touched binary(14) NOT NULL default '',
+ -- This timestamp is updated whenever a page is re-parsed and
+ -- it has all the link tracking tables updated for it. This is
+ -- useful for de-duplicating expensive backlink update jobs.
+ page_links_updated varbinary(14) NULL default NULL,
+
-- Handy key to revision.rev_id of the current revision.
-- This may be 0 during page creation, but that shouldn't
-- happen outside of a transaction... hopefully.